int numSubarrayProductLessThanK(int* nums, int numsSize, int k)
{
    if(k<=1)
        return 0;
    int l=0,r=0,sum=1,cnt=0;
    for(r=0;r<numsSize;r++)
    {
        sum*=nums[r];
        while(sum>=k)
            sum/=nums[l++];
        cnt+=r-l+1;
    }
    return cnt;
}
